Jump to content

Template talk:Defn

Page contents not supported in other languages.
From Wikipedia, the free encyclopedia

Definition numbers and hanging indents in multiple definitions

[edit]

When a term has multiple definitions, {{defn|no=}} can be used to number them. However, if the definition extends over multiple lines, the number does not stand out. It would be nice if there were a parameter to wrap the definition, including the number, in {{hanging indent}} to produce rendering like

foo
Ten pounds of campaign promises in a five lb. bag.
bar
1.

Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

2.  See baz

It would also be nice if there were parameters to automatically generate the numbers and to specify the largest definition number in order to get consistent indenting. Shmuel (Seymour J.) Metz Username:Chatul (talk) 13:47, 13 November 2022 (UTC)[reply]

@Chatul: Sorry for the late response. I know what you mean on the first point, and its possible this could be addressed by WP:Template styles. However, it would need to consistently indent the same amount on subsequent lines as the numbering indents the text on the first line, and I'm not sure that's doable. Your example above ends up looking like a block quotatation at the second line and is visually confusing, because it indents much more than the first line is indented by "1. " at the start of it. And this might be an issue with the {{hanging indent}} template in general, which not everyone is a fan of to begin with. (I saw someone remove it from an MoS page recently as unhelpful, for example). On the second matter, automated anything would require completely redoing this as a WP:Module in Lua instead of the built-in templating language, and that is beyond my skill set, though I guess someone else could consider taking it on.  — SMcCandlish ¢ 😼  15:49, 2 October 2023 (UTC)[reply]

References?

[edit]

How are references used in the {{defn}} template? Seems like they're not supported. -- Mikeblas (talk) 13:47, 2 October 2023 (UTC)[reply]

@Mikeblas: Same as anywhere else:
snorkweasel
Some definition text,[1] yadda yadda yadda.[2]
nextTermHere
NextDefinitionHere

...

References

  1. ^ Persson, Una (2023). The Official Book of Cool Stuff. pp. xiv, 38.
  2. ^ Guye, Random (2 October 2023). "So Much Wow!". The Nitpicky Times. p. 7.
You may need to use {{defn|1=...}} not just {{defn|...}}, because citations involve use of the = character, though in the above example I did not. But it is always safer to use {{defn|1=...}}, because you cannot predict what future editors will do to the content, perhaps without closely examining the output in preview.  — SMcCandlish ¢ 😼  15:43, 2 October 2023 (UTC)[reply]
Thanks! I had tried that, but it didn't work. Turns out I was tripping over some other referencing error in the article. Turns out refs do work as expetced. -- Mikeblas (talk) 15:44, 2 October 2023 (UTC)[reply]
Glad it worked out. :-)  — SMcCandlish ¢ 😼  15:50, 2 October 2023 (UTC)[reply]